package cn.bblocks.cacheTest.suport;

import cn.bblocks.cacheTest.suport.dto.DTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

/**
 * @program:
 * @author: captain.ma
 * @date: 2018-11-20
 * @since: 1.0.0.0
 */
@ToString
@AllArgsConstructor
@Builder
@Data
@NoArgsConstructor
public class PageableDTO<T extends DTO>   {

    private  T parameters;
    private  Pageable pageable=PageRequest.of(0,1000, Sort.by(Sort.Direction.DESC,"id"));
    


    public PageableDTO pageable(PageRequest of) {
        pageable=of;
        return this;
    } public PageableDTO parameters(T t) {
        parameters=t;
        return this;
    }
}
